#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>

typedef struct ListNode
{
    int val;
    struct ListNode* next;
}ListNode;

ListNode* partition(ListNode* pHead, int x) {
    ListNode* newhead = (ListNode*)malloc(sizeof(ListNode));
    newhead->next = pHead;
    ListNode* before = pHead;
    ListNode* after = newhead;
   
}

int main()
{
    struct ListNode* a1 = (struct ListNode*)malloc(sizeof(struct ListNode));
    struct ListNode* a2 = (struct ListNode*)malloc(sizeof(struct ListNode));
    struct ListNode* a3 = (struct ListNode*)malloc(sizeof(struct ListNode));
    struct ListNode* a4 = (struct ListNode*)malloc(sizeof(struct ListNode));
    struct ListNode* a5 = (struct ListNode*)malloc(sizeof(struct ListNode));
    struct ListNode* a6 = (struct ListNode*)malloc(sizeof(struct ListNode));
    a1->val = 6;
    a2->val = 2;
    a3->val = 8;
    a4->val = 1;
    a5->val = 3;
    a6->val = 4;
    struct ListNode* head1 = a1;
    struct ListNode* head2 = a4;
    a1->next = a2;
    a2->next = a3;
    a3->next = NULL;

    a4->next = a5;
    a5->next = a6;
    a6->next = NULL;
    struct ListNode* ret = partition(head1, 9);


    return 0;
}